<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/inc/taglibs.jsp"%>
<SCRIPT type="text/javascript">
var setting = {
	callback: {
		onClick: onClickModuleTree
	} 
};
function refreshSidebarTree(){
	$.getJSON(siteServer + "/rms/module/getModuleTree.do", function(zNodes){
		$.fn.zTree.init($("#siderbarTree"), setting, zNodes);
	});
}
function onClickModuleTree(event, treeId, treeNode, clickFlag){
	//alert('event='+event +' treeId=' + treeId + ' treeNode.tid='+treeNode.tId + '  clickFlag='+clickFlag);
	var moduleid = treeNode.moduleid;
	var targetUrl = treeNode.targetUrl;
	if(!msmall.isNullOrEmpty(targetUrl)){
		$.ajax({
	    url: siteServer + targetUrl,
	    type: 'GET',
	    dataType: 'html',
	    timeout: 1000,
	    error: function(err){
	        alert('此节点有错 : ' + err);
	    },
	    success: function(html){
	    	$("#main_main").html(html);
	    }
		});
	}
}
$(document).ready(function(){
	refreshSidebarTree();
});
</SCRIPT>
<div id="main_sidebar" class="main_sidebar">
	<ul id="siderbarTree" class="ztree"></ul>
</div>
<div id="main_toggle" class="main_toggle">
	<a onclick="frameSet.toggle();" href="javascript:void(0)" hidefocus="true" title="收起左侧菜单栏" id="toggle"></a>
</div>
<div id="main_main" class="main_main">
</div>